package com.atguigu.e_date;


import java.util.Date;

public class Demo {
    public static void main(String[] args) {

        //无参构造
        Date date = new Date();

        //Sun Oct 08 16:02:26 CST[东八区] 2023 [GMT:零时区]
        System.out.println("date = " + date); //现在

        //有参构造
        Date date1 = new Date(1000);
        //Thu Jan 01 08:00:00 CST 1970
        System.out.println("date1 = " + date1);

        //获取时间
        System.out.println("date.getTime() = " + date.getTime());
        System.out.println("System.currentTimeMillis() = " + System.currentTimeMillis());

        System.out.println("date1.getTime() = " + date1.getTime());//1000

        System.out.println("---------------------------");

        //设置时间
        date.setTime(1000 * 60);
        //Thu Jan 01 08:00:00 CST 1970
        System.out.println("date = " + date);
    }
}
